package com.io.test;

import java.io.*;

/**
 * @author Li
 * @Date 2023/4/21 16:32
 */
public class OutPutDemo3 {

    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("我的故乡.txt");//先读取，输入流
        FileOutputStream fos = new FileOutputStream("我的家乡.txt");
        int by; //一次读一个字节数据
        while ((by = fis.read() ) !=-1){
            fos.write(by);
        }
        fos.close();
        fis.close();
    }
}
